home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-26 | 25.1 KB | 829 lines | [TEXT/CWIE] |
- unit WASTE;
-
- { Pascal interface to the WASTE text engine }
-
- { version 1.2 (June 1996) }
-
- { Copyright © 1993-1996 Marco Piovanelli }
- { All Rights Reserved }
-
- interface
- uses
- ConditionalMacros,
- Types,
- MixedMode,
- QuickdrawText,
- Quickdraw,
- Script,
- TextUtils,
- TextEdit,
- Drag,
- LongCoords;
-
- {$PUSH}
- {$ALIGN MAC68K}
- {$LibExport+}
-
- const
-
- { result codes }
-
- weCantUndoErr = -10015; { undo buffer is clear (= errAECantUndo) }
- weEmptySelectionErr = -10013; { empty selection range (= errAENoUserSelection) }
- weNotHandledErr = -1708; { please use default behavior (= errAEEventNotHandled) }
- weUnknownObjectTypeErr = -9478; { specified object type is not registered }
- weObjectNotFoundErr = -9477; { no object found at specified offset }
- weReadOnlyErr = -9476; { cannot modify instance }
- weUndefinedSelectorErr = -50; { unknown selector (= paramErr) }
-
- { alignment styles }
-
- weFlushLeft = -2; { flush left }
- weFlushRight = -1; { flush right }
- weFlushDefault = 0; { flush according to system direction }
- weCenter = 1; { centered }
- weJustify = 2; { fully justified }
-
- { values for the mode parameter in WESetStyle and WEContinuousStyle }
-
- weDoFont = $0001; { set font family number }
- weDoFace = $0002; { set Quickdraw styles }
- weDoSize = $0004; { set type size }
- weDoColor = $0008; { set color }
- weDoAll = weDoFont + weDoFace + weDoSize + weDoColor;
- weDoAddSize = $0010; { adjust type size }
- weDoToggleFace = $0020; { turn a style off if it's continuous over the selection }
- weDoReplaceFace = $0040; { replace existing styles outright }
- weDoPreserveScript = $0080; { don't change scripts when applying a font change }
- weDoExtractSubscript = $0100; { extract subscripts when applying a font change }
- weDoFaceMask = $0200; { set Quickdraw styles using mask field }
-
- { values for the edge parameter in WEGetOffset etc. }
-
- kLeadingEdge = -1; { point is on the leading edge of a glyph }
- kTrailingEdge = 0; { point is on the trailing edge of a glyph }
- kObjectEdge = 2; { point is in the middle of an embedded object }
-
- { values for WEFeatureFlag feature parameter }
-
- weFAutoScroll = 0; { automatically scroll the selection range into view }
- weFOutlineHilite = 2; { frame selection when deactivated }
- weFReadOnly = 5; { disallow modifications }
- weFUndo = 6; { support WEUndo }
- weFIntCutAndPaste = 7; { use intelligent cut-and-paste rules }
- weFDragAndDrop = 8; { support drag-and-drop text editing }
- weFInhibitRecal = 9; { don't recalculate line starts and don't redraw text }
- weFUseTempMem = 10; { use temporary memory for main data structures }
- weFDrawOffscreen = 11; { draw text offscreen for smoother visual results }
- weFInhibitRedraw = 12; { don't redraw text }
- weFMonoStyled = 13; { disallow style changes }
- weFInhibitColor = 31; { draw in black & white only }
-
- { values for WENew flags parameter }
-
- weDoAutoScroll = $00000001;
- weDoOutlineHilite = $00000004;
- weDoReadOnly = $00000020;
- weDoUndo = $00000040;
- weDoIntCutAndPaste = $00000080;
- weDoDragAndDrop = $00000100;
- weDoInhibitRecal = $00000200;
- weDoUseTempMem = $00000400;
- weDoDrawOffscreen = $00000800;
- weDoInhibitRedraw = $00001000;
- weDoMonoStyled = $00002000;
- weDoInhibitColor = $80000000;
-
- { values for WEFeatureFlag action parameter }
-
- weBitToggle = -2; { toggles the specified feature }
- weBitTest = -1; { returns the current setting of the specified feature }
- weBitClear = 0; { disables the specified feature }
- weBitSet = 1; { enables the specified feature }
-
- { values for WEGetInfo and WESetInfo selector parameter }
-
- weCharByteHook = 'cbyt'; { CharByte hook }
- weCharToPixelHook = 'c2p '; { CharToPixel hook }
- weCharTypeHook = 'ctyp'; { CharType hook }
- weClickLoop = 'clik'; { click loop callback }
- weCurrentDrag = 'drag'; { drag currently being tracked from WEClick }
- weDrawTextHook = 'draw'; { text drawing hook }
- weHiliteDropAreaHook = 'hidr'; { drop area highlighting hook }
- weLineBreakHook = 'lbrk'; { line breaking hook }
- wePixelToCharHook = 'p2c '; { PixelToChar hook }
- wePort = 'port'; { graphics port }
- weRefCon = 'refc'; { reference constant for use by application }
- weScrollProc = 'scrl'; { scroll callback }
- weText = 'text'; { handle to the raw text }
- weTranslateDragHook = 'xdrg'; { drag translation callback }
- weTSMDocumentID = 'tsmd'; { Text Services Manager document ID }
- weTSMPreUpdate = 'pre '; { Text Services Manager pre-update callback }
- weTSMPostUpdate = 'post'; { Text Services Manager post-update callback }
- weURLHint = 'urlh'; { URL hint string for Internet Config }
- weWordBreakHook = 'wbrk'; { word breaking hook }
-
- { values for WEInstallObjectHandler handlerSelector parameter }
-
- weNewHandler = 'new '; { new handler }
- weDisposeHandler = 'free'; { dispose handler }
- weDrawHandler = 'draw'; { draw handler }
- weClickHandler = 'clik'; { click handler }
- weStreamHandler = 'strm'; { stream handler }
-
- { action kinds }
-
- weAKNone = 0; { null action }
- weAKUnspecified = 1; { action of unspecified nature }
- weAKTyping = 2; { some text has been typed in }
- weAKCut = 3; { the selection range has been cut }
- weAKPaste = 4; { something has been pasted }
- weAKClear = 5; { the selection range has been deleted }
- weAKDrag = 6; { drag and drop operation }
- weAKSetStyle = 7; { some style has been applied to a text range }
-
- { destination kinds for stream handler }
-
- weToScrap = 0;
- weToDrag = 1;
- weToSoup = 2;
-
- type
-
- { if we're using a pre-2.1 version of the Universal Headers, define EventModifiers }
- {$IFC UNDEFINED UNIVERSAL_INTERFACES_VERSION}
- type
- EventModifiers = Integer;
- {$ENDC}
-
- { WASTE data types }
-
- WEReference = Ptr;
- WEObjectReference = Ptr;
- WESoupHandle = Handle;
- WEActionKind = Integer;
- WEAlignment = SignedByte;
- WEStyleMode = Integer;
- WESelector = FourCharCode;
- WEHandle = WEReference; { obsolete; kept for backward compatibility }
-
- WERunInfo = record
- runStart: LongInt; { byte offset to first character of style run }
- runEnd: LongInt; { byte offset past last character of style run }
- runHeight: Integer; { line height (ascent + descent + leading) }
- runAscent: Integer; { font ascent }
- runStyle: TextStyle; { text attributes }
- runObject: WEObjectReference; { either NIL or reference to embedded object }
- end; { WERunInfo }
-
- { callback prototypes }
-
- { FUNCTION MyClickLoop(we: WEReference): Boolean; }
- WEClickLoopProcPtr = ProcPtr;
- WEClickLoopUPP = UniversalProcPtr;
-
- { PROCEDURE MyScrollProc(we: WEReference); }
- WEScrollProcPtr = ProcPtr;
- WEScrollUPP = UniversalProcPtr;
-
- { PROCEDURE MyTSMPreUpdate(we: WEReference); }
- WETSMPreUpdateProcPtr = ProcPtr;
- WETSMPreUpdateUPP = UniversalProcPtr;
-
- { PROCEDURE MyTSMPostUpdate(we: WEReference; fixLength: LongInt; }
- { inputAreaStart, inputAreaEnd:LongInt; }
- { pinRangeStart, pinRangeEnd: LongInt); }
- WETSMPostUpdateProcPtr = ProcPtr;
- WETSMPostUpdateUPP = UniversalProcPtr;
-
- { FUNCTION MyTranslateDrag (theDrag: DragReference; theItem: ItemReference; }
- { requestedType: FlavorType; putDataHere: Handle): OSErr; }
- WETranslateDragProcPtr = ProcPtr;
- WETranslateDragUPP = UniversalProcPtr;
-
- { FUNCTION MyHiliteDropArea (theDrag: DragReference; hiliteFlag: Boolean; }
- { we: WEReference); }
- WEHiliteDropAreaProcPtr = ProcPtr;
- WEHiliteDropAreaUPP = UniversalProcPtr;
-
- { PROCEDURE MyDrawText (pText: Ptr; textLength: LongInt; slop: Fixed; }
- { styleRunPosition: JustStyleCode; we: WEReference); }
- WEDrawTextProcPtr = ProcPtr;
- WEDrawTextUPP = UniversalProcPtr;
-
- { FUNCTION MyPixelToChar (pText: Ptr; textLength: LongInt; slop: Fixed; }
- { var pixelWidth: Fixed; var edge: SignedByte; }
- { styleRunPosition: JustStyleCode; hPos: Fixed; we: WEReference): LongInt; }
- WEPixelToCharProcPtr = ProcPtr;
- WEPixelToCharUPP = UniversalProcPtr;
-
- { FUNCTION MyCharToPixel (pText: Ptr; textLength: LongInt; slop: Fixed; }
- { offset: LongInt; direction: Integer; }
- { styleRunPosition: JustStyleCode; hPos: LongInt; we:WEReference): Integer; }
- WECharToPixelProcPtr = ProcPtr;
- WECharToPixelUPP = UniversalProcPtr;
-
- { FUNCTION MyLineBreak (pText: Ptr; textLength: LongInt; }
- { textStart, textEnd: LongInt; var textWidth: Fixed; var textOffset: LongInt; }
- { we: WEReference): StyledLineBreakCode; }
- WELineBreakProcPtr = ProcPtr;
- WELineBreakUPP = UniversalProcPtr;
-
- { PROCEDURE MyWordBreak (pText: Ptr; textLength, offset: Integer; edge: SignedByte; }
- { var breakOffsets: OffsetTable; script: ScriptCode; we: WEReference); }
- WEWordBreakProcPtr = ProcPtr;
- WEWordBreakUPP = UniversalProcPtr;
-
- { FUNCTION MyCharByte (pText: Ptr; textOffset: Integer; }
- { script: ScriptCode; we: WEReference): Integer; }
- WECharByteProcPtr = ProcPtr;
- WECharByteUPP = UniversalProcPtr;
-
- { FUNCTION MyCharType (pText: Ptr; textOffset: Integer; }
- { script: ScriptCode; we: WEReference): Integer; }
- WECharTypeProcPtr = ProcPtr;
- WECharTypeUPP = UniversalProcPtr;
-
- { FUNCTION MyNewObject (var defaultObjectSize: Point; }
- { objectRef: WEObjectReference): OSErr; }
- WENewObjectProcPtr = ProcPtr;
- WENewObjectUPP = UniversalProcPtr;
-
- { FUNCTION MyDisposeObject (objectRef: WEObjectReference): OSErr; }
- WEDisposeObjectProcPtr = ProcPtr;
- WEDisposeObjectUPP = UniversalProcPtr;
-
- { FUNCTION MyDrawObject (var destRect: Rect; }
- { objectRef: WEObjectReference): OSErr }
- WEDrawObjectProcPtr = ProcPtr;
- WEDrawObjectUPP = UniversalProcPtr;
-
- { FUNCTION MyClickObject (hitPt: Point; modifiers: EventModifiers; clickTime: LongInt; }
- { objectRef: WEObjectReference): Boolean; }
- WEClickObjectProcPtr = ProcPtr;
- WEClickObjectUPP = UniversalProcPtr;
-
- { FUNCTION MyStreamObject (destKind: Integer; var theType: FlavorType; }
- { putDataHere: Handle; objectRef: WEObjectReference): OSErr; }
- WEStreamObjectProcPtr = ProcPtr;
- WEStreamObjectUPP = UniversalProcPtr;
-
- const
-
- { UPP proc info }
-
- uppWEClickLoopProcInfo = $000000D0;
- uppWEScrollProcInfo = $000000C0;
- uppWETSMPreUpdateProcInfo = $000000C0;
- uppWETSMPostUpdateProcInfo = $0003FFC0;
- uppWETranslateDragProcInfo = $0003FFE0;
- uppWEHiliteDropAreaProcInfo = $00000DE0;
- uppWEDrawTextProcInfo = $0000EFC0;
- uppWEPixelToCharProcInfo = $003EFFF0;
- uppWECharToPixelProcInfo = $003EBFE0;
- uppWELineBreakProcInfo = $000FFFD0;
- uppWEWordBreakProcInfo = $000EDAC0;
- uppWECharByteProcInfo = $00003AE0;
- uppWECharTypeProcInfo = $00003AE0;
- uppWENewObjectProcInfo = $000003E0;
- uppWEDisposeObjectProcInfo = $000000E0;
- uppWEDrawObjectProcInfo = $000003E0;
- uppWEClickObjectProcInfo = $00003ED0;
- uppWEStreamObjectProcInfo = $00003FA0;
-
- { NewProc macros }
-
- function NewWEClickLoopProc (userRoutine: WEClickLoopProcPtr): WEClickLoopUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEScrollProc (userRoutine: WEScrollProcPtr): WEScrollUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWETSMPreUpdateProc (userRoutine: WETSMPreUpdateProcPtr): WETSMPreUpdateUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWETSMPostUpdateProc (userRoutine: WETSMPostUpdateProcPtr): WETSMPostUpdateUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWETranslateDragProc (userRoutine: WETranslateDragProcPtr): WETranslateDragUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEHiliteDropAreaProc (userRoutine: WEHiliteDropAreaProcPtr): WEHiliteDropAreaUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEDrawTextProc (userRoutine: WEDrawTextProcPtr): WEDrawTextUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEPixelToCharProc (userRoutine: WEPixelToCharProcPtr): WEPixelToCharUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWECharToPixelProc (userRoutine: WECharToPixelProcPtr): WECharToPixelUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWELineBreakProc (userRoutine: WELineBreakProcPtr): WELineBreakUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEWordBreakProc (userRoutine: WEWordBreakProcPtr): WEWordBreakUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWECharByteProc (userRoutine: WECharByteProcPtr): WECharByteUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWECharTypeProc (userRoutine: WECharTypeProcPtr): WECharTypeUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWENewObjectProc (userRoutine: WENewObjectProcPtr): WENewObjectUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEDisposeObjectProc (userRoutine: WEDisposeObjectProcPtr): WEDisposeObjectUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEDrawObjectProc (userRoutine: WEDrawObjectProcPtr): WEDrawObjectUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEClickObjectProc (userRoutine: WEClickObjectProcPtr): WEClickObjectUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- function NewWEStreamObjectProc (userRoutine: WEStreamObjectProcPtr): WEStreamObjectUPP;
- {$IFC NOT GENERATINGCFM}
- inline
- $2E9F;
- {$ENDC}
-
- { CallProc macros }
-
- function CallWEClickLoopProc (we: WEReference;
- userRoutine: WEClickLoopUPP): Boolean;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- procedure CallWEScrollProc (we: WEReference;
- userRoutine: WEScrollUPP);
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- procedure CallWETSMPreUpdateProc (we: WEReference;
- userRoutine: WETSMPreUpdateUPP);
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- procedure CallWETSMPostUpdateProc (we: WEReference;
- fixLength: LongInt;
- inputAreaStart, inputAreaEnd: LongInt;
- pinRangeStart, pinRangeEnd: LongInt;
- userRoutine: WETSMPostUpdateUPP);
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWETranslateDragProc (theDrag: DragReference;
- theItem: ItemReference;
- requestedType: FlavorType;
- putDataHere: Handle;
- userRoutine: WETranslateDragUPP): OSErr;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWEHiliteDropAreaProc (theDrag: DragReference;
- hiliteFlag: Boolean;
- we: WEReference;
- userRoutine: WEHiliteDropAreaUPP): OSErr;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- procedure CallWEDrawTextProc (pText: Ptr;
- textLength: LongInt;
- slop: Fixed;
- styleRunPosition: JustStyleCode;
- we: WEReference;
- userRoutine: WEDrawTextUPP);
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWEPixelToCharProc (pText: Ptr;
- textLength: LongInt;
- slop: Fixed;
- var width: Fixed;
- var edge: SignedByte;
- styleRunPosition: JustStyleCode;
- hPos: Fixed;
- we: WEReference;
- userRoutine: WEPixelToCharUPP): LongInt;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWECharToPixelProc (pText: Ptr;
- textLength: LongInt;
- slop: Fixed;
- offset: LongInt;
- direction: Integer;
- styleRunPosition: JustStyleCode;
- hPos: LongInt;
- we: WEReference;
- userRoutine: WECharToPixelUPP): Integer;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWELineBreakProc (pText: Ptr;
- textLength: LongInt;
- textStart, textEnd: LongInt;
- var textWidth: Fixed;
- var textOffset: LongInt;
- we: WEReference;
- userRoutine: WELineBreakUPP): StyledLineBreakCode;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- procedure CallWEWordBreakProc (pText: Ptr;
- textLength, offset: Integer;
- edge: SignedByte;
- var breakOffsets: OffsetTable;
- script: ScriptCode;
- we: WEReference;
- userRoutine: WEWordBreakUPP);
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWECharByteProc (pText: Ptr;
- textOffset: Integer;
- script: ScriptCode;
- we: WEReference;
- userRoutine: WECharByteUPP): Integer;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWECharTypeProc (pText: Ptr;
- textOffset: Integer;
- script: ScriptCode;
- we: WEReference;
- userRoutine: WECharTypeUPP): Integer;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWENewObjectProc (var defaultObjectSize: Point;
- objectRef: WEObjectReference;
- userRoutine: WENewObjectUPP): OSErr;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWEDisposeObjectProc (objectRef: WEObjectReference;
- userRoutine: WEDisposeObjectUPP): OSErr;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWEDrawObjectProc ({const} var destRect: Rect;
- objectRef: WEObjectReference;
- userRoutine: WEDrawObjectUPP): OSErr;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWEClickObjectProc (hitPoint: Point;
- modifiers: EventModifiers;
- clickTime: LongInt;
- objectRef: WEObjectReference;
- userRoutine: WEClickObjectUPP): Boolean;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
- function CallWEStreamObjectProc (destKind: Integer;
- var theType: FlavorType;
- putDataHere: Handle;
- objectRef: WEObjectReference;
- userRoutine: WEStreamObjectUPP): OSErr;
- {$IFC NOT GENERATINGCFM}
- inline
- $205F, $4E90;
- {$ENDC}
-
-
- { WASTE PUBLIC CALLS }
-
- { getting the shared library version number }
-
- function WEVersion: NumVersion;
-
- { creation and destruction }
-
- function WENew ({const} var destRect, viewRect: LongRect;
- flags: LongInt;
- var we: WEReference): OSErr;
- procedure WEDispose (we: WEReference);
-
- { getting variables }
-
- function WEGetText (we: WEReference): Handle;
- function WEGetChar (offset: LongInt;
- we: WEReference): Char;
- function WEGetTextLength (we: WEReference): LongInt;
- function WECountLines (we: WEReference): LongInt;
- function WEGetHeight (startLine, endLine: LongInt;
- we: WEReference): LongInt;
- procedure WEGetSelection (var selStart, selEnd: LongInt;
- we: WEReference);
- procedure WEGetDestRect (var destRect: LongRect;
- we: WEReference);
- procedure WEGetViewRect (var viewRect: LongRect;
- we: WEReference);
- function WEIsActive (we: WEReference): Boolean;
- function WEOffsetToLine (offset: LongInt;
- we: WEReference): LongInt;
- procedure WEGetLineRange (lineNo: LongInt;
- var lineStart, lineEnd: LongInt;
- we: WEReference);
- function WEGetClickCount (we: WEReference): Integer;
-
- { setting variables }
-
- procedure WESetSelection (selStart, selEnd: LongInt;
- we: WEReference);
- procedure WESetDestRect ({const} var destRect: LongRect;
- we: WEReference);
- procedure WESetViewRect ({const} var viewRect: LongRect;
- we: WEReference);
-
- { accessing style run information }
-
- function WEContinuousStyle (var mode: WEStyleMode;
- var ts: TextStyle;
- we: WEReference): Boolean;
- procedure WEGetRunInfo (offset: LongInt;
- var info: WERunInfo;
- we: WEReference);
-
- { converting byte offsets to screen positions and vice versa }
- function WEGetOffset ({const} var thePoint: LongPt;
- var edge: SignedByte;
- we: WEReference): LongInt;
- procedure WEGetPoint (offset: LongInt;
- direction: Integer;
- var thePoint: LongPt;
- var lineHeight: Integer;
- we: WEReference);
-
- { finding words and lines }
- procedure WEFindWord (offset: LongInt;
- edge: SignedByte;
- var wordStart, wordEnd: LongInt;
- we: WEReference);
- procedure WEFindLine (offset: LongInt;
- edge: SignedByte;
- var lineStart, lineEnd: LongInt;
- we: WEReference);
-
- { making a copy of a text range }
-
- function WECopyRange (rangeStart, rangeEnd: LongInt;
- hText: Handle;
- hStyles: StScrpHandle;
- hSoup: WESoupHandle;
- we: WEReference): OSErr;
-
- { getting and setting the alignment style }
-
- function WEGetAlignment (we: WEReference): WEAlignment;
- procedure WESetAlignment (alignment: WEAlignment;
- we: WEReference);
-
- { recalculating line breaks, drawing and scrolling }
-
- function WECalText (we: WEReference): OSErr;
- procedure WEUpdate (updateRgn: RgnHandle;
- we: WEReference);
- procedure WEScroll (hOffset, vOffset: LongInt;
- we: WEReference);
- procedure WESelView (we: WEReference);
-
- { handling activate/deactivate events }
-
- procedure WEActivate (we: WEReference);
- procedure WEDeactivate (we: WEReference);
-
- { handling key-down events }
-
- procedure WEKey (key: Char;
- modifiers: EventModifiers;
- we: WEReference);
-
- { handling mouse-down events and mouse tracking }
-
- procedure WEClick (hitPt: Point;
- modifiers: EventModifiers;
- clickTime: LongInt;
- we: WEReference);
-
- { adjusting the cursor shape }
-
- function WEAdjustCursor (mouseLoc: Point;
- mouseRgn: RgnHandle;
- we: WEReference): Boolean;
-
- { blinking the caret }
-
- procedure WEIdle (var maxSleep: LongInt;
- we: WEReference);
-
- { modifying the text and the styles }
-
- function WEInsert (pText: Ptr;
- textLength: LongInt;
- hStyles: StScrpHandle;
- hSoup: WESoupHandle;
- we: WEReference): OSErr;
- function WEDelete (we: WEReference): OSErr;
- function WESetStyle (mode: WEStyleMode;
- {const} var ts: TextStyle;
- we: WEReference): OSErr;
- function WEUseText (hText: Handle;
- we: WEReference): OSErr;
- function WEUseStyleScrap (hStyles: StScrpHandle;
- we: WEReference): OSErr;
-
- { undo }
-
- function WEUndo (we: WEReference): OSErr;
- procedure WEClearUndo (we: WEReference);
- function WEGetUndoInfo (var redoFlag: Boolean;
- we: WEReference): WEActionKind;
- function WEIsTyping (we: WEReference): Boolean;
-
- { keeping track of changes }
-
- function WEGetModCount (we: WEReference): LongInt;
- procedure WEResetModCount (we: WEReference);
-
- { embedded objects }
-
- function WEInstallObjectHandler (objectType: FlavorType;
- handlerSelector: WESelector;
- handler: ProcPtr;
- we: WEReference): OSErr;
- function WEGetObjectHandler (objectType: FlavorType;
- handlerSelector: WESelector;
- var handler: ProcPtr;
- we: WEReference): OSErr;
- function WEInsertObject (objectType: FlavorType;
- objectDataHandle: Handle;
- objectSize: Point; { (0, 0) means default size }
- we: WEReference): OSErr;
- function WEGetSelectedObject (var objectRef: WEObjectReference;
- we: WEReference): OSErr;
- function WEFindNextObject (offset: LongInt;
- var objectRef: WEObjectReference;
- we: WEReference): LongInt;
- function WEUseSoup (hSoup: WESoupHandle;
- we: WEReference): LongInt;
-
- { accessing embedded object attributes }
- function WEGetObjectType (objectRef: WEObjectReference): FlavorType;
- function WEGetObjectDataHandle (objectRef: WEObjectReference): Handle;
- function WEGetObjectSize (objectRef: WEObjectReference): Point;
- function WEGetObjectOwner (objectRef: WEObjectReference): WEReference;
- function WEGetObjectRefCon (objectRef: WEObjectReference): LongInt;
- procedure WESetObjectRefCon (objectRef: WEObjectReference;
- refCon: LongInt);
-
- { Clipboard operations }
- function WECut (we: WEReference): OSErr;
- function WECopy (we: WEReference): OSErr;
- function WEPaste (we: WEReference): OSErr;
- function WECanPaste (we: WEReference): Boolean;
-
- { Drag Manager support }
- function WEGetHiliteRgn (rangeStart, rangeEnd: LongInt;
- we: WEReference): RgnHandle;
- function WETrackDrag (message: DragTrackingMessage;
- drag: DragReference;
- we: WEReference): OSErr;
- function WEReceiveDrag (drag: DragReference;
- we: WEReference): OSErr;
- function WECanAcceptDrag (drag: DragReference;
- we: WEReference): Boolean;
- function WEDraggedToTrash (drag: DragReference): Boolean;
-
- { Script Manager utilities }
- function WECharByte (offset: LongInt;
- we: WEReference): Integer;
- function WECharType (offset: LongInt;
- we: WEReference): Integer;
-
- { Text Services Manager support }
- function WEInstallTSMHandlers: OSErr;
- function WERemoveTSMHandlers: OSErr;
- procedure WEStopInlineSession (we: WEReference);
-
- { additional features }
- function WEFeatureFlag (feature: Integer;
- action: Integer;
- we: WEReference): Integer;
- function WEGetInfo (selector: WESelector;
- info: univ Ptr;
- we: WEReference): OSErr;
- function WESetInfo (selector: WESelector;
- info: univ Ptr;
- we: WEReference): OSErr;
-
- { long coordinates utility routines }
- procedure WELongPointToPoint ({const} var lp: LongPt;
- var p: Point);
- procedure WEPointToLongPoint (p: Point;
- var lp: LongPt);
- procedure WESetLongRect (var lr: LongRect;
- left, top, right, bottom: LongInt);
- procedure WELongRectToRect ({const} var lr: LongRect;
- var r: Rect);
- procedure WERectToLongRect ({const} var r: Rect;
- var lr: LongRect);
- procedure WEOffsetLongRect (var lr: LongRect;
- hOffset, vOffset: LongInt);
- function WELongPointInLongRect ({const} var lp: LongPt;
- {const} var lr: LongRect): Boolean;
-
- {$ALIGN RESET}
- {$POP}
-
- implementation
- end.